package utils

import "time"

const (
	StdFormat = "2006-01-02 15:04:05.000"
)

func TimestampToStr(msec int64) string {
	t := time.Unix(msec/1e3, (msec%1e3)*1e6)
	return t.Format(StdFormat)
}

func UnixMilli() int64 {
	return time.Now().UnixNano() / 1e6
}

func TimeToUnixMilli(t time.Time) int64 {
	return t.UnixNano() / 1e6
}
